import * as VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'

const routes = [

    { path: '/', redirect: '/login' },
    { path: '/login', component: Login },
    {
        path: '/home', component: Home, redirect: '/home/UserInfo',
        children: [
            {
                path: 'Works', component: () => import('../views/Works.vue')
            },
            {
                path: 'Order', component: () => import('../views/Order.vue')
            },
            {
                path: 'User', component: () => import('../views/User.vue')
            },
            {
                path: 'Logistics', component: () => import('../views/Logistics.vue')
            },
            {
                path: 'UserInfo', component: () => import('../views/UserInfo.vue')
            },
            {
                path: 'Fenye', component: () => import('../views/Fenye.vue')
            }
        ]
    },
]
const router = VueRouter.createRouter({
    history: VueRouter.createWebHashHistory(),
    routes,
})

export default router

